import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import reportWebVitals from './reportWebVitals';
import {Welcome} from "./components/Welcome";
import {MyComponent} from "./components/01";
const name = 'Josh Perez';
const element = <h1>Hello, {name}</h1>;
const root = ReactDOM.createRoot(
    document.getElementById('root') as HTMLElement
);
// createElement( 标签,标签属性,子标签)
// h2 与h222效果等同
//  const h22 = (
//     <h1 classNam e='ys'>你是憨憨</h1>
//   )
const h2 = React.createElement('div', {className: 'ys'},
    <div>当前时间：{  new Date().toLocaleTimeString()}</div>
)
root.render(
    <React.StrictMode>
        <Welcome name='自定义组件1'/>
        <MyComponent/>
        {element}
        {h2}

    </React.StrictMode>
);


reportWebVitals();
